home *** CD-ROM | disk | FTP | other *** search
- class Heroes.AttackBox extends Heroes.AnyBox
- {
- var grandParent;
- var myBox;
- var power;
- var forceFall;
- function AttackBox()
- {
- super();
- this.grandParent = this._parent._parent._name;
- if(this._parent._parent.facing == "right")
- {
- this.myBox = new Heroes.Box(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
- }
- else
- {
- this.myBox = new Heroes.Box(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2,this._width,this._height,this._width);
- }
- this.attack();
- }
- function onEnterFrame()
- {
- if(this._parent._parent.facing == "right")
- {
- this.myBox.setLocation(this._x + this._parent._parent.x,this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
- }
- else
- {
- this.myBox.setLocation(this._parent._parent.x - this._x - this._width,- this._parent._parent.y - this._y,this._parent._parent.z - this._width / 2);
- }
- this.myBox.setSize(this._width,this._height,this._width);
- this.attack();
- }
- function attack()
- {
- if(this._parent._parent.facing == "right")
- {
- this._parent._parent._parent.player.onAttack(this.myBox,this.power,this.forceFall,this._parent._parent.facing,this._parent._parent._x + this._x,this._parent._parent._y + this._y - this._height / 2);
- }
- else
- {
- this._parent._parent._parent.player.onAttack(this.myBox,this.power,this.forceFall,this._parent._parent.facing,this._parent._parent._x - this._x,this._parent._parent._y + this._y - this._height / 2);
- }
- }
- }
-